﻿<UserControl x:Class="Peter.Sdw.View.SubBookEditView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:logic="clr-namespace:Peter.Sdw.Logic"
             xmlns:icons="clr-namespace:Peter.Common.Icons;assembly=Peter.Common"
             xmlns:controls="clr-namespace:Peter.Common.Controls;assembly=Peter.Common"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300"
             d:DataContext="{d:DesignInstance logic:SubBookModel}">

   <Grid Margin="5,0,0,0">
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto" />
         <RowDefinition Height="Auto" />
         <RowDefinition Height="Auto" />
         <RowDefinition Height="Auto" />
         <RowDefinition Height="Auto" />
         <RowDefinition Height="Auto" />
         <RowDefinition Height="Auto" />
         <RowDefinition Height="Auto" />
         <RowDefinition Height="Auto" />
         <RowDefinition Height="Auto" />
      </Grid.RowDefinitions>
      <TextBlock Text="Sub Book Details"
                 FontWeight="Bold"
                 Grid.Row="0" />
      <TextBlock Text="Term"
                 Grid.Row="1" />
      <Grid Grid.Row="2">
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
         </Grid.ColumnDefinitions>
         <TextBox Text="{Binding Path=TermName}"
                  Grid.Column="0"
                  IsReadOnly="True" />
         <Button Grid.Column="1"
                 Margin="5,0,0,0"
                 ToolTip="Select a Term"
                 CommandParameter="subbook"
                 Command="{Binding Path=SelectTermCommand}">
            <icons:IconDisplay Icon="Browser"
                               Margin="5,0" />
         </Button>
      </Grid>
      <TextBlock Text="Alias"
                 Grid.Row="3" />
      <TextBox Text="{Binding Path=Alias}"
               Grid.Row="4" />
      <TextBlock Text="Order"
                 Grid.Row="5" />
      <controls:NumericUpDown Value="{Binding Path=Order}"
                              Precision="0"
                              Grid.Row="6" />
      <CheckBox Content="Hide"
                Grid.Row="7"
                Margin="0,5,0,0"
                VerticalAlignment="Center"
                VerticalContentAlignment="Center"
                IsChecked="{Binding Path=Hide}" />
      <Button Grid.Row="8"
              Margin="0,5,0,0"
              Style="{DynamicResource ButtonSuccess}"
              Command="{Binding Path=AddChaptersCommand}">
         <StackPanel Orientation="Horizontal">
            <icons:IconDisplay Icon="Createfile"
                               IconSize="Small" />
            <TextBlock Text="Add Chapters"
                       Margin="4,0"
                       VerticalAlignment="Center" />
         </StackPanel>
      </Button>
      <Button ToolTip="Delete this Sub Book"
              Style="{DynamicResource ButtonError}"
              Command="{Binding Path=DeleteCommand}"
              Margin="0,5,0,0"
              Grid.Row="9">
         <StackPanel Orientation="Horizontal">
            <icons:IconDisplay Icon="Trash" />
            <TextBlock Text="Delete"
                       Margin="5,0,0,0" />
         </StackPanel>
      </Button>
   </Grid>
</UserControl>
